package com.hclc.yxb.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hclc.entity.model.enums.PermTypeEnum;
import com.hclc.entity.model.series.CustomLocalDateTimeSerializer;
import com.hclc.entity.model.series.DeCustomLocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>角色表</p>
 * @author hef
 * @since 2020-08-23
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper=false)
@Accessors(chain = true)
@TableName("`t_sys_role`")
public class SysRoleModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value="`id`", type= IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    /**
     * 角色名称
     */
    @TableField(value = "`role_name`")
    @ApiModelProperty(value = "角色名称")
    private String roleName;

    /**
     * 名称描述
     */
    @TableField(value = "`role_desc`")
    @ApiModelProperty(value = "名称描述")
    private String roleDesc;

    /**
     * 菜单权限类型{ALL,1,全部;SECTION,0,部分}
     */
    @TableField("`perm_type`")
    @ApiModelProperty(value = "菜单权限类型{ALL,1,全部;SECTION,0,部分}")
    private PermTypeEnum permType;


    /**
     * 是否有效(1:有效,0:无效)
     */
    @TableField(value = "`enable`")
    @ApiModelProperty(value = "是否有效(1:有效,0:无效)")
    private Integer enable;

    /**
     * 备注
     */
    @TableField(value = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 状态
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "状态")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonDeserialize(using = DeCustomLocalDateTimeSerializer.class)
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    @JsonDeserialize(using = DeCustomLocalDateTimeSerializer.class)
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

    /**
     * 创建时间(时间戳)
     */
    @TableField(value = "`create_time_timestamp`", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间(时间戳)")
    private Long createTimeTimestamp;

    /**
     * 更新时间(时间戳)
     */
    @TableField(value = "`update_time_timestamp`", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间(时间戳)")
    private Long updateTimeTimestamp;


}
